package org.goldenport.g3.events.view

import org.goldenport.g3.G3Event
import org.goldenport.g3.events._
import org.goldenport.g3.messages.RecordSet
import org.goldenport.g3.messages.view._

/**
 * @since   Aug. 27, 2010
 * @version Oct.  5, 2010
 * @author  ASAMI, Tomoharu
 */
trait ViewEvent extends G3Event

class ViewFetched(
  uri: String,
  val view: ViewCommand,
  val records: RecordSet,
  cause: Option[G3Event] = None
) extends Getted(uri, Some(records), cause) with ViewEvent {
  input = Some(view)
}

class ViewQueried(
  uri: String,
  val view: ViewCommand,
  val records: RecordSet,
  cause: Option[G3Event] = None
) extends Getted(uri, Some(records), cause) with ViewEvent {
  input = Some(view)
}

class ViewExceptioned(
  uri: String, cmd: ViewCommand,
  exception: Exception) extends CatchExceptioned(uri, exception, command = Some(cmd)) with ViewEvent {
}
